package com.example.designpartten.factory;

public class HumanFactory extends AbstratHumanFactory {


    @Override
    public <T extends Human> T createHuman(Class<T> c) {
        Human human = null;

        try {
            human = (T) Class.forName(c.getName()).newInstance();
        }catch (Exception e) {
            System.out.println("生成人类错误!");
        }
        return (T) human;
    }
}
